<script setup lang="ts">
import { toRefs } from "vue";
import _ from "lodash";
import assets from "@/utils/assets";
let props = defineProps(["checked"]);

let { checked } = toRefs(props);
let emit = defineEmits(["click", "update:checked"]);

let handleClick = () => {
  let val = !checked?.value;
  emit("click", val);
  emit("update:checked", val);
};

let handleGo = () => {
  uni.navigateTo({
    url: "/pages/user-pricacy-page/index",
  });
};
</script>

<template>
  <div class="user-privacy">
    <div class="com-radio" @click="handleClick">
      <img :src="assets.radio_checked" v-if="checked" class="radio-img" />
      <img :src="assets.radio_default" v-else class="radio-img" />
    </div>
    <span class="text" @click="handleGo"> 《用户服务协议及隐私政策》 </span>
  </div>
</template>

<style lang="less" scoped>
.user-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 39rpx;
  padding-bottom: 32rpx;
}
.com-radio {
  width: 26rpx;
  height: 26rpx;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.radio-img {
  width: 26rpx;
  height: 26rpx;
}
.text {
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 26rpx;
  color: #333333;
}
</style>
